home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Dots & Pixels / headers / port.h < prev    next >
C/C++ Source or Header  |  1995-09-29  |  2KB  |  94 lines

  1. #pragma once
  2.  
  3. class port : public general
  4. {
  5.     public:
  6.         ~port();
  7.         void use() const;
  8.         void get_rect( Rect *rect) const;
  9.         void get_pixH( PixMapPtr *pix) const;
  10.         void copyfrom( const port &source, const short mode = srcCopy,
  11.                                         const RgnHandle maskRgn = 0) const;
  12.  
  13.         void copyfrom( const port &source, const Rect &origRect, const Rect &destRect,
  14.                         const short mode = srcCopy, const RgnHandle maskRgn = 0) const;
  15.  
  16.         void copyfrom( const port &source, const Rect &origRect,
  17.                         const short mode = srcCopy, const RgnHandle maskRgn = 0) const;
  18.  
  19.         void copyfrom( const port &source, const port &mask,
  20.                         const short mode = srcCopy, const RgnHandle maskRgn = 0) const;
  21.  
  22.         void copyfrom( const port &source, const port &mask, const Rect &origRect,
  23.                             const Rect &maskRect, const Rect &destRect,
  24.                         const short mode = srcCopy, const RgnHandle maskRgn = 0) const;
  25.  
  26.         void scroll( short dh, short dv) const;
  27.  
  28.         PicHandle getPICT() const;
  29.  
  30.         GWorldPtr getGWorld() const;
  31.         GDHandle  getGDevice() const;
  32.         
  33.         void cls_black() const;
  34.         void cls_white() const;
  35.         void invert() const;
  36.  
  37.         void SetColorTable( short resID) const;
  38.         void SetColorTable( CTabHandle theColorTable) const;
  39.         
  40.     protected:
  41.         static const port *currentport;
  42.         
  43.         GWorldPtr    myGWorldPtr;
  44.         GDHandle     myGDHandle;
  45.         
  46.         Rect         myRect;
  47.         PixMapPtr    myPix;        
  48. };
  49.  
  50. inline void port::get_rect( Rect *rect) const
  51. {
  52.     *rect   = myRect;
  53. }
  54.  
  55. inline void port::get_pixH( PixMapPtr *pix) const
  56. {
  57.     *pix = myPix;
  58. }
  59.  
  60. inline void port::copyfrom( const port &source, const short mode, const RgnHandle maskRgn) const
  61. {
  62.     use();
  63.     CopyBits( (BitMapPtr)(source.myPix), (BitMapPtr)myPix,
  64.                     &(source.myRect), &myRect, mode, maskRgn);
  65. }
  66.  
  67. inline GWorldPtr port::getGWorld() const
  68. {
  69.     return myGWorldPtr;
  70. }
  71.  
  72. inline GDHandle port::getGDevice() const
  73. {
  74.     return myGDHandle;
  75. }
  76.  
  77. inline void port::cls_black() const
  78. {
  79.     use();
  80.     PaintRect( &myRect);
  81. }
  82.  
  83. inline void port::cls_white() const
  84. {
  85.     use();
  86.     EraseRect( &myRect);
  87. }
  88.  
  89. inline void port::invert() const
  90. {
  91.     use();
  92.     InvertRect( &myRect);
  93. }
  94.